/*
 * 
 * Version 1.00
 * 
 * Created on 2007-6-4
 * Encoding GB2312
 */
package net.comm.shequ.service.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.List;
import java.util.Vector;

import net.comm.common.GlbFinal;
import net.comm.common.ReturnMessage;
import net.comm.common.common;
import net.comm.file.service.impl.FilesServiceImpl;
import net.comm.file.web.form.FilesForm;
import net.comm.friend.db.DbFriendService;

import net.comm.shequ.bean.BaseWyServe;
import net.comm.shequ.db.DbWyServeService;
import net.comm.shequ.db.WyServeServiceSqlMysql;
import net.comm.shequ.web.form.WyServeForm;
import net.comm.page.PageCtr;
import net.comm.param.service.impl.SequenceMgr;

import net.comm.util.DatetimeUtil;
import net.comm.util.DbcpPool;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.log4j.Logger;
import org.sakaiproject.db.impl.BasicSqlService;


/**
 *
 * @author hcgong(hcgong@sina.com)
 * @version 1.0
 * @date 2007-6-4
 */
public class WyServeServiceImpl {

	static Logger logger = Logger.getLogger(WyServeServiceImpl.class.getName());

	/**
	 * 
	 * @see net.IUserbasicService.module.other.IUserService
	 * 		#list(net.swift.module.other.ExaQueryBean, net.swift.common.ReturnMessage)
	 */
	public List list(WyServeForm theForm,  ReturnMessage msg) 
	{
		List list = null;

		Connection cn = null;

		try
		{
			cn = DbcpPool.getConnection();
			
			WyServeServiceSqlMysql servSql = new WyServeServiceSqlMysql();
			BasicSqlService  bSqlServ = new BasicSqlService();

			Object[] fields2 = new Object[1];
			
			fields2[0] = theForm.getQryWuyeID();

			String sql = servSql.getCountSql2();

			/**
			 * 根据SQL执行结果计算分页相关信息
			 */
			PageCtr page = theForm.getPage();
			page.setTotalNum(bSqlServ.dbCount(cn, sql, fields2));
			page.caculate();

			//取得FORM中传入的查询参数
			Object[] fields = new Object[3];
			
			fields[0] = theForm.getQryWuyeID();
			fields[1] = page.getPos()-1;
			fields[2] = page.getPageSize();
			
			sql = servSql.getRecbyPageSql();
	
			list = bSqlServ.dbRead(cn, sql, fields, new DbWyServeService());
			
		    DbcpPool.returnConnection(cn);
		    
		} catch(Exception ex) 
		{
			/**
			 * 记录相关日志
			 */
			logger.error(ex.getMessage());
			try 
			{
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
			} catch(Exception ex1) 
			{
				ex1.printStackTrace();
				logger.error("事务回滚操作失败!ExaServiceImpl->add(01)" , ex1);
			}			
			
		} finally {
			DbcpPool.returnConnection(cn);
		}		
		
		return list;
	}
	
	/**
	 * 
	 * @see net.IUserbasicService.module.other.IUserService
	 * 		#list(net.swift.module.other.ExaQueryBean, net.swift.common.ReturnMessage)
	 */
	public List listcomment(WyServeForm theForm,  ReturnMessage msg) 
	{
		List list = null;

		Connection cn = null;

		try
		{
			cn = DbcpPool.getConnection();
			
			WyServeServiceSqlMysql servSql = new WyServeServiceSqlMysql();
			BasicSqlService  bSqlServ = new BasicSqlService();

			Object[] fields2 = new Object[1];
			
			fields2[0] = theForm.getQrySeqID();

			String sql = servSql.getCountSql3();

			/**
			 * 根据SQL执行结果计算分页相关信息
			 */
			PageCtr page = theForm.getPage();
			page.setTotalNum(bSqlServ.dbCount(cn, sql, fields2));
			page.caculate();

			//取得FORM中传入的查询参数
			Object[] fields = new Object[3];
			
			fields[0] = theForm.getQrySeqID();
			fields[1] = page.getPos()-1;
			fields[2] = page.getPageSize();
			
			sql = servSql.getRecCommentbyPageSql();
	
			list = bSqlServ.dbRead(cn, sql, fields, new DbWyServeService());
			
		    DbcpPool.returnConnection(cn);
		    
		} catch(Exception ex) 
		{
			/**
			 * 记录相关日志
			 */
			logger.error(ex.getMessage());
			try 
			{
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
			} catch(Exception ex1) 
			{
				ex1.printStackTrace();
				logger.error("事务回滚操作失败!ExaServiceImpl->add(01)" , ex1);
			}			
			
		} finally {
			DbcpPool.returnConnection(cn);
		}		
		
		return list;
	}
	
	/**
	 * 
	 * @see net.IUserbasicService.module.other.IUserService
	 * 		#list(net.swift.module.other.ExaQueryBean, net.swift.common.ReturnMessage)
	 */
	public List adlist(WyServeForm theForm,  ReturnMessage msg) 
	{
		List list = new Vector();

		Connection cn = null;
		Statement stmt=null;
		ResultSet rs=null;
		try
		{
			cn = DbcpPool.getConnection();
			
			WyServeServiceSqlMysql servSql = new WyServeServiceSqlMysql();
			
			StringBuffer sb = new StringBuffer(" where 1=1 ");

			if(theForm.getQrySeqID() > 0){
				
				sb.append(" and SeqID = ");
				sb.append(theForm.getQrySeqID());
				sb.append(" ");
			}
			
			if(theForm.getQryWuyeID() > 0){
				
				sb.append(" and WuyeID = ");
				sb.append(theForm.getQryWuyeID());
				sb.append(" ");
			}
			
			String QryStatus = theForm.getQryStatus().replaceAll(GlbFinal.SQLINjection, " ");
			if(!QryStatus.equals("")){
				
				sb.append(" and Status = '");
				sb.append(QryStatus);
				sb.append("' ");
			}
			
			if(theForm.getFollID() > 0){
				
				sb.append(" and FollID = ");
				sb.append(theForm.getFollID());
				sb.append(" ");
			}
			String qryOrderby = theForm.getQryOrderby().replaceAll(GlbFinal.SQLINjection, " ");
			if(!qryOrderby.equals("")){
				
				sb.append(" Order by ");
				sb.append(qryOrderby);
				sb.append(" ");
			}else{
				
				sb.append(" Order by SeqID desc, FollID ");
			}
			
			//查询记录数
			stmt = cn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
			String sql = servSql.getCountSql1();

			logger.debug(sql+sb.toString());
			rs=stmt.executeQuery(sql+sb.toString());
			int nRows = 0;
			if (rs.next())
	           nRows = rs.getInt("COUNT");
			else
			{
	            rs.close();
	            stmt.close();
	            DbcpPool.returnConnection(cn);
			    return list;
			}
			/**
			 * 根据SQL执行结果计算分页相关信息
			 */
			PageCtr page = theForm.getPage();
			page.setTotalNum(nRows);
			page.caculate();

			sb.append(" limit ");
			sb.append(page.getPos()-1);
			sb.append(", ");
			sb.append(page.getPageSize());
			
			 //取记录
			 sql = servSql.getRecSql();
			 logger.debug(sql+sb.toString());
			 DbWyServeService dbuser = new DbWyServeService();
			 
			 rs=stmt.executeQuery(sql+sb.toString());
			 while (rs.next())
			 {
				try
				{
					Object obj = dbuser.readSqlResultRecord(rs);
					if (obj != null) list.add(obj);
				}
				catch (Throwable t)
				{
					logger.error(t.getMessage());
				}		
			 }
			 rs.close();
			 stmt.close();
		     DbcpPool.returnConnection(cn);

		} catch(Exception ex) 
		{
			/**
			 * 记录相关日志
			 */
			logger.error(ex.getMessage());
			try {
				if (rs != null)
					rs.close();
				if (stmt != null)
					stmt.close();
				DbcpPool.returnConnection(cn);
			} catch (Exception ex1) {
				ex1.printStackTrace();
			}			
	    }finally {
			try {
				if (rs != null)
					rs.close();
				if (stmt != null)
					stmt.close();
			} catch (Exception ex) {
				ex.printStackTrace();
			}			
			DbcpPool.returnConnection(cn);
		}		
		return list;
	}		

	/**
	 * @see net.IUserbasicService.module.other.IUserService
	 * 		#get(net.swift.db.tab_paramnostro, net.swift.common.ReturnMessage)
	 */
	public int getMaxFollID(int seqID,ReturnMessage msg) 
	{
		Connection cn = null;
		int follID = 0;
		try
		{
			cn = DbcpPool.getConnection();
			List list = null;

			//取得FORM中传入的查询参数
			Object[] fields = new Object[1];
			
			fields[0] = seqID;			
			
			WyServeServiceSqlMysql servSql = new WyServeServiceSqlMysql();			
			BasicSqlService  bSqlServ = new BasicSqlService();
			
			String sql = servSql.getMaxFollIDSql();			
					
			list = bSqlServ.dbRead(cn, sql, fields, new DbWyServeService());
			
			if(list.size() ==0){
				common.setAppFailMsg(msg , " 取记录失败，请检查！");
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
				
				return follID;				
			}
			
			BaseWyServe base = (BaseWyServe)list.get(0);
				
			follID = base.getFollID() + 1;
			
			DbcpPool.returnConnection(cn);
			return follID;
			
		} catch(Exception ex) 
		{
			logger.error("System error , param get about invite" + ex);
			try 
			{
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
			} catch(Exception ex1) 
			{
				ex1.printStackTrace();
				logger.error("事务回滚操作失败!ExaServiceImpl->add(01)" , ex1);
			}			
		} finally {
			DbcpPool.returnConnection(cn);
		}
		
		return follID;
	}
	
	/**
	 * @see net.IUserbasicService.module.other.IUserService
	 * 		#get(net.swift.db.tab_paramnostro, net.swift.common.ReturnMessage)
	 */
	public void get(WyServeForm theForm, ReturnMessage msg) 
	{
		Connection cn = null;
		try
		{
			cn = DbcpPool.getConnection();
			List list = null;

			WyServeServiceSqlMysql servSql = new WyServeServiceSqlMysql();			
			BasicSqlService  bSqlServ = new BasicSqlService();

			//取得FORM中传入的查询参数
			Object[] fields = new Object[2];
			
			fields[0] = theForm.getSeqID();			
			fields[1] = theForm.getFollID();			
			
			String sql = servSql.getbykeySql();			
					
			list = bSqlServ.dbRead(cn, sql, fields, new DbWyServeService());
			if(list.size() ==0){
				common.setAppFailMsg(msg , " 取记录失败，请检查！");
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
				return;				
			}
			
			BaseWyServe base = (BaseWyServe)list.get(0);
				
			BeanUtils.copyProperties(theForm, base);
			
			//更新点击次数
			if(theForm.getFollID() == 0){
				Object[] fields2 = new Object[5];
				
				fields2[0] = base.getStatus();		//	状态
				fields2[1] = base.getAttachcnt() + 1;		//	点击次数
				fields2[2] = base.getReplycnt();		//	回复次数
				fields2[3] = theForm.getSeqID();		//	序号
				fields2[4] = theForm.getFollID();		//	跟贴序号
			
				sql = servSql.getUpdstsSql();			
				
				boolean  res = bSqlServ.dbWrite(cn, sql, fields2);
				if(!res){
					common.setAppFailMsg(msg , " 更新记录失败，请检查！");
					DbcpPool.rollBackTran(cn);
					DbcpPool.closeTran(cn);
					DbcpPool.returnConnection(cn);
					return;
				}			
			}
			
			DbcpPool.returnConnection(cn);
			return;
			
		} catch(Exception ex) 
		{
			logger.error("System error , param get about invite" + ex);
			common.setAppFailMsg(msg , ex.getMessage());
			try 
			{
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
			} catch(Exception ex1) 
			{
				ex1.printStackTrace();
				logger.error("事务回滚操作失败!ExaServiceImpl->add(01)" , ex1);
			}			
		} finally {
			DbcpPool.returnConnection(cn);
		}
		
		return ;
	}
	/**
	 * 添加表中
	 * @see net.IUserbasicService.module.other.IUserService#add(net.swift.common.ReturnMessage)
	 */
	public void add(WyServeForm theForm, ReturnMessage msg) 
	{
		
		Connection cn = null;
		
		try
		{
			cn = DbcpPool.getConnection();
	
			DbcpPool.beginTran(cn);
			
			WyServeServiceSqlMysql servSql = new WyServeServiceSqlMysql();
			BasicSqlService  bSqlServ = new BasicSqlService();
			
			int follID = 0;
			//取跟帖序号
			if(theForm.getSeqID() > 0){
				
				follID = getMaxFollID( theForm.getSeqID(), msg);
				if(msg.getErrCode() != 0){
					return;
				}
				theForm.setFollID(follID);
			}else{
				theForm.setSeqID(SequenceMgr.generateSeq(GlbFinal.SEQ_INITDATE, GlbFinal.SEQ_NOTADVID));
			}
			//保存附件一
			if(theForm.getFilepath() != null&&!theForm.getFilepath().getFileName().equals("")){
				
				FilesForm fileForm = new FilesForm();
				fileForm.setFormFile(theForm.getFilepath());
				fileForm.setF_info(theForm.getTitle());
				fileForm.setF_Zip(GlbFinal.ZIP_600);
				
				FilesServiceImpl fileservice = new FilesServiceImpl();
				
				fileservice.add(cn, fileForm, msg);
				if(msg.getErrCode() != 0){
					return;
				}
				theForm.setF_ID(fileForm.getF_ID());
			}			

			
			//取得FORM中传入的查询参数
			Object[] fields = new Object[13];
						
			fields[0] = theForm.getSeqID();			//	序号
			fields[1] = theForm.getFollID();		//	跟贴序号
			fields[2] = theForm.getWuyeID();		//	
			fields[3] = theForm.getNtype();			//	类型
			fields[4] = theForm.getTitle();			//	标题
			fields[5] = theForm.getContent();		//	发贴/跟贴内容
			fields[6] = theForm.getF_ID();			//	附件ID
			fields[7] = theForm.getStatus();		//	状态
			fields[8] = theForm.getAttachcnt();	//	点击次数
			fields[9] = theForm.getReplycnt();		//	回复次数
			fields[10] = theForm.getUserID();		//	会员ID
			fields[11] = theForm.getIP();			//	用户IP
			fields[12] = DatetimeUtil.getDatetime();	//	最后修改时间
			
			String sql = servSql.getInsertSql();
						
			boolean  res = bSqlServ.dbWrite(cn, sql, fields);
			if(!res){
				common.setAppFailMsg(msg , " 保存数据失败！");
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
				return;
			}
			//更新回复数量
			if(theForm.getFollID() > 0){
				
				WyServeForm serveForm = new WyServeForm();
				
				serveForm.setSeqID(theForm.getSeqID());
				serveForm.setReplycnt(1);
				
				updsts(cn,serveForm, msg);
				if(msg.getErrCode() != 0){
					return;
				}
				
			}
			
			DbcpPool.commitTran(cn);
			DbcpPool.closeTran(cn);
			DbcpPool.returnConnection(cn);
			
		} catch(Exception ex) 
		{
			common.setAppFailMsg(msg , ex.getMessage());
			logger.error("System error , param get about operlog" + ex);
			try 
			{
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
			} catch(Exception ex1) 
			{
				ex1.printStackTrace();
				logger.error("事务回滚操作失败!ExaServiceImpl->add(01)" , ex1);
			}			
		} finally {
			DbcpPool.returnConnection(cn);
		}
		
		return;
	}

	/**
	 * 删除一条指定记录
	 * @see net.IUserbasicService.module.other.IUserService#update(net.swift.common.ReturnMessage)
	 */
	public void delete(WyServeForm theForm, ReturnMessage msg) 
	{
		
		Connection cn = null;
		try
		{
			cn = DbcpPool.getConnection();
			
			DbcpPool.beginTran(cn);

			//取得FORM中传入的查询参数
			Object[] fields = new Object[2];
			
			fields[0] = theForm.getSeqID();
			fields[1] = theForm.getFollID();
			
			WyServeServiceSqlMysql servSql = new WyServeServiceSqlMysql();
			BasicSqlService  bSqlServ = new BasicSqlService();
			String sql = servSql.getDeleteSql();
			
								
			boolean  res = bSqlServ.dbWrite(cn, sql, fields);
			if(res){
				common.setAppFailMsg(msg , " 更新记录失败，请检查！");
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
				return;
			}
			
			DbcpPool.commitTran(cn);
			DbcpPool.closeTran(cn);
			DbcpPool.returnConnection(cn);
			return;
			
		} catch(Exception ex) 
		{
			logger.error("System error , param get about invite" + ex);
			common.setAppFailMsg(msg , ex.getMessage());
			try 
			{
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
			} catch(Exception ex1) 
			{
				ex1.printStackTrace();
				logger.error("事务回滚操作失败!ExaServiceImpl->add(01)" , ex1);
			}			
		} finally {
			DbcpPool.returnConnection(cn);
		}
		
		return ;
	}

	/**
	 * 更新一条指定记录
	 * @see net.IUserbasicService.module.other.IUserService#update(net.swift.common.ReturnMessage)
	 */
	public void update(WyServeForm theForm, ReturnMessage msg) 
	{
		
		Connection cn = null;
		try
		{
			cn = DbcpPool.getConnection();
			
			DbcpPool.beginTran(cn);
			List list = null;

			//取得FORM中传入的查询参数
			Object[] fields = new Object[2];
			
			fields[0] = theForm.getSeqID();			
			fields[1] = theForm.getFollID();			
			
			WyServeServiceSqlMysql servSql = new WyServeServiceSqlMysql();
			BasicSqlService  bSqlServ = new BasicSqlService();
			
			String sql = servSql.getbykeySql();			
					
			list = bSqlServ.dbRead(cn, sql, fields, new DbWyServeService());
			
			if(list.size() ==0){
				common.setAppFailMsg(msg , " 取记录失败，请检查！");
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
				return;				
			}
			BaseWyServe base = (BaseWyServe)list.get(0);
				
			Object[] fields2 = new Object[13];
			
			fields[0] = theForm.getWuyeID();		//	
			fields[1] = theForm.getNtype();			//	类型
			fields[2] = theForm.getTitle();			//	标题
			fields[3] = theForm.getContent();		//	发贴/跟贴内容
			fields[4] = theForm.getF_ID();			//	附件ID
			fields[5] = theForm.getStatus();		//	状态
			fields[6] = theForm.getAttachcnt();		//	点击次数
			fields[7] = theForm.getReplycnt();		//	回复次数
			fields[8] = theForm.getUserID();		//	会员ID
			fields[9] = theForm.getIP();			//	用户IP
			fields[10] = DatetimeUtil.getDatetime();	//	最后修改时间
			fields[11] = theForm.getSeqID();		//	序号
			fields[12] = theForm.getFollID();		//	跟贴序号
		
			sql = servSql.getUpdateSql();			
			
			boolean  res = bSqlServ.dbWrite(cn, sql, fields2);
			if(!res){
				common.setAppFailMsg(msg , " 更新记录失败，请检查！");
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
				return;
			}

			DbcpPool.commitTran(cn);
			DbcpPool.closeTran(cn);
			DbcpPool.returnConnection(cn);
			return;
			
		} catch(Exception ex) 
		{
			logger.error("System error , param get about invite" + ex);
			common.setAppFailMsg(msg , ex.getMessage());
			try 
			{
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
			} catch(Exception ex1) 
			{
				ex1.printStackTrace();
				logger.error("事务回滚操作失败!ExaServiceImpl->add(01)" , ex1);
			}			
		} finally {
			DbcpPool.returnConnection(cn);
		}
				
		return ;
	}
	/**
	 * 更新一条指定记录
	 * @see net.IUserbasicService.module.other.IUserService#update(net.swift.common.ReturnMessage)
	 */
	public void updsts(WyServeForm theForm, ReturnMessage msg) 
	{
		
		Connection cn = null;
		try
		{
			cn = DbcpPool.getConnection();
			
			DbcpPool.beginTran(cn);
			
			updsts(cn, theForm, msg);
			if(msg.getErrCode() != 0){
				return;
			}

			DbcpPool.commitTran(cn);
			DbcpPool.closeTran(cn);
			DbcpPool.returnConnection(cn);
			return;
			
		} catch(Exception ex) 
		{
			logger.error("System error , param get about invite" + ex);
			common.setAppFailMsg(msg , ex.getMessage());
			try 
			{
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
			} catch(Exception ex1) 
			{
				ex1.printStackTrace();
				logger.error("事务回滚操作失败!ExaServiceImpl->add(01)" , ex1);
			}			
		} finally {
			DbcpPool.returnConnection(cn);
		}
				
		return ;
	}
	/**
	 * 更新一条指定记录
	 * @see net.IUserbasicService.module.other.IUserService#update(net.swift.common.ReturnMessage)
	 */
	public void updsts(Connection cn, WyServeForm theForm, ReturnMessage msg) 
	{
		
		try
		{
			List list = null;

			//取得FORM中传入的查询参数
			Object[] fields = new Object[2];
			
			fields[0] = theForm.getSeqID();			
			fields[1] = 0;			
			
			WyServeServiceSqlMysql servSql = new WyServeServiceSqlMysql();
			BasicSqlService  bSqlServ = new BasicSqlService();
			
			String sql = servSql.getbykeySql();			
					
			list = bSqlServ.dbRead(cn, sql, fields, new DbWyServeService());
			
			if(list.size() ==0){
				common.setAppFailMsg(msg , " 取记录失败，请检查！");
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
				return;				
			}
			BaseWyServe base = (BaseWyServe)list.get(0);
			
			if(theForm.getStatus().equals("")){
				theForm.setStatus(base.getStatus());
			}
				
			Object[] fields2 = new Object[5];
			
			fields2[0] = theForm.getStatus();		//	状态
			fields2[1] = base.getAttachcnt() + theForm.getAttachcnt();		//	点击次数
			fields2[2] = base.getReplycnt() + theForm.getReplycnt();		//	回复次数
			fields2[3] = theForm.getSeqID();		//	序号
			fields2[4] = 0;						//	跟贴序号
		
			sql = servSql.getUpdstsSql();			
			
			boolean  res = bSqlServ.dbWrite(cn, sql, fields2);
			if(!res){
				common.setAppFailMsg(msg , " 更新记录失败，请检查！");
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
				return;
			}

			return;
			
		} catch(Exception ex) 
		{
			logger.error("System error , param get about invite" + ex);
			common.setAppFailMsg(msg , ex.getMessage());
			try 
			{
				DbcpPool.rollBackTran(cn);
				DbcpPool.closeTran(cn);
				DbcpPool.returnConnection(cn);
			} catch(Exception ex1) 
			{
				ex1.printStackTrace();
				logger.error("事务回滚操作失败!ExaServiceImpl->add(01)" , ex1);
			}			
		} finally {
		}
				
		return ;
	}	
	
}
